import request from '@/utils/request'

/**
 * 获取企业列表
 * @param { page, pageSize} params
 * @returns
 */
export const getEnterpriseListAPI = (params) => request.get('/park/enterprise', { params })
/**
 * 获取行业列表
 * @returns
 */
export const getIndustryListAPI = () => request.get('/park/industry')

/**
 * 上传合同
 * @returns
 */
export const uploadAPI = (data) => request.post('/upload', data)
/**
 * 创建公司
 * @param {*} data
 * @returns
 */
export const createExterpriseAPI = (data) => request.post('/park/enterprise', data)
/**
* 获取合同详情
* @param {*} id
* @returns
*/
export const getEnterpriseDetailAPI = (id) => request.get(`/park/enterprise/${id}`)
/**
* 修改公司
* @param {*} data
* @returns
*/
export const updateExterpriseAPI = (data) => request.put(`/park/enterprise/${data.id}`, data)
/**
* 删除公司
* @param {*} id
* @returns
*/
export const delExterpriseAPI = (id) => request.delete(`/park/enterprise/${id}`)
/**
* 获取楼宇列表
* @param {*} params
* @returns
*/
export const getRentBuildListAPI = () => request.get('/park/rent/building')
/**
 * 创建合同
 * @param {*}
 * @returns
 */
export const createRentAPI = (data) => request.post('/park/enterprise/rent', data)

/**
 * 获取合同列表
 * @param {*} id
 * @returns
 */
export const getRentListAPI = (id) => request.get(`/park/enterprise/rent/${id}`)
/**
 * 退租
 * @param {合同id} rentId
 * @returns
 */
export const outRentAPI = (rentId) => request.put(`/park/enterprise/rent/${rentId}`)
/**
 * 获取详情
 * @param {企业id} id
 * @returns
 */

export const getEnterpriseDetail = (id) => request.get(`/park/enterprise/${id}`)

